<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 *留言记录
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'edit';
if($_RQ['op']=='edit'){
	$item=pdo_get('jy_aihire_jianli',array('mid'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']));
	$item['gonginfo']=$item['gonginfo']?json_decode($item['gonginfo'],true):array();
	$item['xueinfo']=$item['xueinfo']?json_decode($item['xueinfo'],true):array();
	$item['xianginfo']=$item['xianginfo']?json_decode($item['xianginfo'],true):array();
	$item['peiinfo']=$item['peiinfo']?json_decode($item['peiinfo'],true):array();
	$item['pcd']=$item['pcd']?json_decode($item['pcd'],true):array('city'=>'');
	$return['item']=$item;
	$return['groups']=pdo_getall('jy_aihire_job_group',array('pid'=>0,'uniacid'=>$_SESSION['uniacid']),array('id','title'),'id');
	foreach($return['groups'] as &$pv){
		$pv['cids']=pdo_getall('jy_aihire_job_group',array('pid'=>$pv['id'],'uniacid'=>$_SESSION['uniacid']),array('id','title'),'id');
	}
	$return['job_type']=$this->job_type;
	$return['xinzhis']=$this->xinzhis;
	$return['xinzhis2']=$this->xinzhis2;
	set_html('title','我的简历');
	exi($return);
}
if($_RQ['op']=='post'){
	$postdata=get_postdata();
	$member=pdo_get('jy_aihire_member',array('id'=>$_SESSION['memberid'],'uniacid'=>$_SESSION['uniacid']));
	$sousuo=$member['nickname'].'|'.$member['usename'].'|'.$member['realname'].'|'.$member['yixiang'].'|'.$member['pingjia'].'|'.$member['jiinfo'].'|'.ijson_encode($postdata['gonginfo']).'|'.ijson_encode($postdata['xueinfo']).'|'.ijson_encode($postdata['xianginfo']).'|'.ijson_encode($postdata['peiinfo']).'|'.ijson_encode($postdata['pcd']);
	$data=array(
		'yixiang'=>$postdata['yixiang'],
		'pingjia'=>$postdata['pingjia'],
		'gonginfo'=>ijson_encode($postdata['gonginfo']),
		'xueinfo'=>ijson_encode($postdata['xueinfo']),
		'xianginfo'=>ijson_encode($postdata['xianginfo']),
		'peiinfo'=>ijson_encode($postdata['peiinfo']),
		'pcd'=>ijson_encode($postdata['pcd']),
		'jiinfo'=>$postdata['jiinfo'],
		'type'=>trim($postdata['type']),
		'gongzhi'=>trim($postdata['gongzhi']),
		'cids'=>trim($postdata['cids']),
		'gongyear'=>trim($postdata['gongyear']),
		'sex'=>trim($member['sex']),
		'xueli'=>trim($member['xueli']),
		'sousuo'=>trim($sousuo),
	);
	$id=intval($postdata['id']);
	if($id){
		pdo_update('jy_aihire_jianli',$data,array('id'=>$id,'uniacid'=>$_SESSION['uniacid']));
	}else{
		$data['uniacid']=$_SESSION['uniacid'];
		$data['mid']=$_SESSION['uid'];
		$data['createtime']=time();
		pdo_insert('jy_aihire_jianli',$data);
	}
	exi('操作成功！','','/home/');
}
